package dataStructures.impl;

/**
 * Value object representing a Binary Tree node
 * 
 * 
 * @author Vikas Bahirwani
 */
public class BinaryTreeNode {

	private int key;
	private Object data;
	BinaryTreeNode leftChild;
	BinaryTreeNode rightChild;
	BinaryTreeNode parent;

	/**
	 * @param key
	 * @param data
	 */
	public BinaryTreeNode(int key, Object data) {
		this.key = key;
		this.data = data;
	}

	/**
	 * @return the key
	 */
	public int getKey() {
		return key;
	}

	/**
	 * @param key
	 *            the key to set
	 */
	public void setKey(int key) {
		this.key = key;
	}

	/**
	 * @return the data
	 */
	public Object getData() {
		return data;
	}

	/**
	 * @param data
	 *            the data to set
	 */
	public void setData(Object data) {
		this.data = data;
	}

	/**
	 * @return the leftChild
	 */
	public BinaryTreeNode getLeftChild() {
		return leftChild;
	}

	/**
	 * @param leftChild
	 *            the leftChild to set
	 */
	public void setLeftChild(BinaryTreeNode leftChild) {
		this.leftChild = leftChild;
	}

	/**
	 * @return the rightChild
	 */
	public BinaryTreeNode getRightChild() {
		return rightChild;
	}

	/**
	 * @param rightChild
	 *            the rightChild to set
	 */
	public void setRightChild(BinaryTreeNode rightChild) {
		this.rightChild = rightChild;
	}

	/**
	 * @return the parent
	 */
	public BinaryTreeNode getParent() {
		return parent;
	}

	/**
	 * @param parent
	 *            the parent to set
	 */
	public void setParent(BinaryTreeNode parent) {
		this.parent = parent;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "BinaryTreeNode [key=" + key + ", data=" + data + "]";
	}

}
